//index.js
//获取应用实例
const {
  swiper, catitems,floordata
} = require("../../request/index");
const app = getApp()

//Page Object
Page({
  data: {
    swiperList:[],
    catitemsList: [],
    floorList: [],
  },
  onLoad(options){
    this.getSwiper();
    this.getCatitems();
    this.getFloordata();
  },
  // 获取轮播图
  getSwiper(){
    swiper().then(res => {
      this.setData({
        swiperList: res.data.message
      })
    })
  },
  // 获取分类数据
  getCatitems() {
    catitems().then(res => {
      this.setData({
        catitemsList: res.data.message
      })
    })
  },
  // 获取楼层数据
  getFloordata() {
    floordata().then(res => {
      this.setData({
        floorList: res.data.message
      })
    })
  },
});